{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>搜索书籍</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/search_books.css' %}">
</head>
<body>
<form action="/blog/search/" method="get">
    <label>
        <input type="text" value="{{ book_name }}" name="search_name">
    </label>
    <input type="submit" value="搜索">
</form>

<table border="1">
    {% if books %}
        <tr>
            <th>书名</th>
            <th>价格</th>
            <th>作者</th>
        </tr>
    {% else %}
        <p>没有找到这本书</p>
    {% endif %}
    {% for i in books %}
        <tr>
            <td>{{ i.title }}</td>
            <td>{{ i.price }}</td>
            <td>{{ i.Author.name }}</td>
        </tr>
    {% endfor %}
</table>
</body>
</html>